
const { defineConfig } = require("@vue/cli-service");

// console.log(process.env); //获取当前的开发环境
console.log("当前的环境是:"+process.env.NODE_ENV);
console.log("当前请求的服务地址是:"+process.env.VUE_APP_BASEURL);
console.log("当前的版本是:"+process.env.VUE_APP_APPVERSION);

module.exports = defineConfig({
  transpileDependencies: true,
  lintOnSave: false,
  publicPath:".",
  outputDir: process.env.VUE_APP_DIR,
  //配置开发服务  代理
  devServer: {
    port: 3030, //项目的端口
    proxy: {
      //代理
      "/api": {
        //动态的拿取地址
        target: process.env.VUE_APP_BASEURL,
        //路径重写
        pathRewrite: {
          "^/api": "",
        },
      },
    },
  },
  // chainWebpack: (config) => { //配置别名 合并webpack配置
  //   config.resolve.alias
  //     .set("&", resolve("src"))
  //     .set("assets", resolve("src/assets"))
  //     .set("components", resolve("src/components"))
  //     .set("layout", resolve("src/layout"))
  //     .set("base", resolve("src/base"))
  //     .set("static", resolve("src/static"));
  // },
});
